﻿using System;

namespace smp.RabbitMq
{
    public interface IPublisher : IDisposable
    {
        /// <summary>
        /// Publish a message to an exchange
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        void Publish<TMessage>(TMessage message);
        /// <summary>
        /// Publish a message to an exchange
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        void Publish(Type messageType, object message);
        /// <summary>
        /// Publish a message to an exchange
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void Publish<TMessage>(TMessage message, byte priority);
        /// <summary>
        /// Publish a message to an exchange
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void Publish(Type messageType, object message, byte priority);
        /// <summary>
        /// Publish a message to an exchange
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        void Publish(string assemblyQualifiedMessageType, string message);
        /// <summary>
        /// Publish a message to an exchange
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void Publish(string assemblyQualifiedMessageType, string message, byte priority);

        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeInMilliSeconds">milliseconds period on sleep queue</param>
        void FuturePublish<TMessage>(TMessage message, int sleepTimeInMilliSeconds);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeSpan">timespan period on sleep queue</param>
        void FuturePublish<TMessage>(TMessage message, TimeSpan sleepTimeSpan);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="futurePublishDateTime">absolute date time the message should be on the sleep queue until</param>
        void FuturePublish<TMessage>(TMessage message, DateTime futurePublishDateTime);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeInMilliSeconds">milliseconds period on sleep queue</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish<TMessage>(TMessage message, int sleepTimeInMilliSeconds, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeSpan">timespan period on sleep queue</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish<TMessage>(TMessage message, TimeSpan sleepTimeSpan, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <typeparam name="TMessage">message</typeparam>
        /// <param name="message">message instance</param>
        /// <param name="futurePublishDateTime">absolute date time the message should be on the sleep queue until</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish<TMessage>(TMessage message, DateTime futurePublishDateTime, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeInMilliSeconds">milliseconds period on sleep queue</param>
        void FuturePublish(Type messageType, object message, int sleepTimeInMilliSeconds);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeSpan">timespan period on sleep queue</param>
        void FuturePublish(Type messageType, object message, TimeSpan sleepTimeSpan);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="futurePublishDateTime">absolute date time the message should be on the sleep queue until</param>
        void FuturePublish(Type messageType, object message, DateTime futurePublishDateTime);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeInMilliSeconds">milliseconds period on sleep queue</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish(Type messageType, object message, int sleepTimeInMilliSeconds, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeSpan">timespan period on sleep queue</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish(Type messageType, object message, TimeSpan sleepTimeSpan, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="messageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="futurePublishDateTime">absolute date time the message should be on the sleep queue until</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish(Type messageType, object message, DateTime futurePublishDateTime, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeInMilliSeconds">milliseconds period on sleep queue</param>
        void FuturePublish(string assemblyQualifiedMessageType, string message, int sleepTimeInMilliSeconds);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeSpan">timespan period on sleep queue</param>
        void FuturePublish(string assemblyQualifiedMessageType, string message, TimeSpan sleepTimeSpan);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="futurePublishDateTime">absolute date time the message should be on the sleep queue until</param>
        void FuturePublish(string assemblyQualifiedMessageType, string message, DateTime futurePublishDateTime);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeInMilliSeconds">milliseconds period on sleep queue</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish(string assemblyQualifiedMessageType, string message, int sleepTimeInMilliSeconds, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="sleepTimeSpan">timespan period on sleep queue</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish(string assemblyQualifiedMessageType, string message, TimeSpan sleepTimeSpan, byte priority);
        /// <summary>
        /// Publish a message to a sleep exchange / queue which will forward to the targeted exchange after a specified period
        /// </summary>
        /// <param name="assemblyQualifiedMessageType">type of message entity</param>
        /// <param name="message">message instance</param>
        /// <param name="futurePublishDateTime">absolute date time the message should be on the sleep queue until</param>
        /// <param name="priority">priroty of message (0 is highest)</param>
        void FuturePublish(string assemblyQualifiedMessageType, string message, DateTime futurePublishDateTime, byte priority);
    }
}
